package cn.ssh.entity;

import java.math.BigDecimal;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * SaleOrderLine entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "SALE_ORDER_LINE", schema = "SCOTT")

public class SaleOrderLine implements java.io.Serializable {

	// Fields

	private BigDecimal odlId;
	private SaleOrder saleOrder;
	private String odlProductName;
	private Double odlProductPrice;
	private Long odlProductCount;

	// Constructors

	/** default constructor */
	public SaleOrderLine() {
	}

	/** full constructor */
	public SaleOrderLine(BigDecimal odlId, SaleOrder saleOrder, String odlProductName, Double odlProductPrice,
			Long odlProductCount) {
		this.odlId = odlId;
		this.saleOrder = saleOrder;
		this.odlProductName = odlProductName;
		this.odlProductPrice = odlProductPrice;
		this.odlProductCount = odlProductCount;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "ODL_ID", unique = true, nullable = false, scale = 0)

	public BigDecimal getOdlId() {
		return this.odlId;
	}

	public void setOdlId(BigDecimal odlId) {
		this.odlId = odlId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ODL_ORDER_ID", nullable = false)

	public SaleOrder getSaleOrder() {
		return this.saleOrder;
	}

	public void setSaleOrder(SaleOrder saleOrder) {
		this.saleOrder = saleOrder;
	}

	@Column(name = "ODL_PRODUCT_NAME", nullable = false, length = 50)

	public String getOdlProductName() {
		return this.odlProductName;
	}

	public void setOdlProductName(String odlProductName) {
		this.odlProductName = odlProductName;
	}

	@Column(name = "ODL_PRODUCT_PRICE", nullable = false, precision = 126, scale = 0)

	public Double getOdlProductPrice() {
		return this.odlProductPrice;
	}

	public void setOdlProductPrice(Double odlProductPrice) {
		this.odlProductPrice = odlProductPrice;
	}

	@Column(name = "ODL_PRODUCT_COUNT", nullable = false, precision = 10, scale = 0)

	public Long getOdlProductCount() {
		return this.odlProductCount;
	}

	public void setOdlProductCount(Long odlProductCount) {
		this.odlProductCount = odlProductCount;
	}

}